home *** CD-ROM | disk | FTP | other *** search
/ Monster Media 1996 #15 / Monster Media Number 15 (Monster Media)(July 1996).ISO / prog_bas / t2win_32.zip / _MED-VOL.FRM < prev    next >
Text File  |  1996-05-14  |  8KB  |  307 lines

  1. VERSION 4.00
  2. Begin VB.Form frmMediaID 
  3.    BorderStyle     =   4  'Fixed ToolWindow
  4.    Caption         =   "Media ID - Volume Label"
  5.    ClientHeight    =   4785
  6.    ClientLeft      =   1890
  7.    ClientTop       =   3270
  8.    ClientWidth     =   7485
  9.    Height          =   5190
  10.    Left            =   1830
  11.    MaxButton       =   0   'False
  12.    MDIChild        =   -1  'True
  13.    ScaleHeight     =   4785
  14.    ScaleWidth      =   7485
  15.    ShowInTaskbar   =   0   'False
  16.    Top             =   2925
  17.    Width           =   7605
  18.    Begin VB.TextBox txt_Result 
  19.       BackColor       =   &H00C0C0C0&
  20.       BorderStyle     =   0  'None
  21.       Height          =   4005
  22.       Left            =   105
  23.       Locked          =   -1  'True
  24.       MultiLine       =   -1  'True
  25.       ScrollBars      =   2  'Vertical
  26.       TabIndex        =   0
  27.       Top             =   630
  28.       Width           =   7260
  29.    End
  30.    Begin Threed.SSPanel SSPanel1 
  31.       Align           =   1  'Align Top
  32.       Height          =   480
  33.       Left            =   0
  34.       TabIndex        =   1
  35.       Top             =   0
  36.       Width           =   7485
  37.       _Version        =   65536
  38.       _ExtentX        =   13203
  39.       _ExtentY        =   847
  40.       _StockProps     =   15
  41.       ForeColor       =   -2147483640
  42.       BackColor       =   12632256
  43.       Begin VB.ComboBox cmb_Function 
  44.          Height          =   315
  45.          Left            =   1365
  46.          TabIndex        =   2
  47.          Top             =   90
  48.          Width           =   4785
  49.       End
  50.       Begin Threed.SSCommand SSCommand1 
  51.          Default         =   -1  'True
  52.          Height          =   300
  53.          Left            =   6615
  54.          TabIndex        =   6
  55.          Top             =   90
  56.          Width           =   465
  57.          _Version        =   65536
  58.          _ExtentX        =   820
  59.          _ExtentY        =   529
  60.          _StockProps     =   78
  61.          Caption         =   "&Go"
  62.          BevelWidth      =   1
  63.          RoundedCorners  =   0   'False
  64.          Outline         =   0   'False
  65.       End
  66.       Begin VB.Label Label2 
  67.          Caption         =   "&Select a function"
  68.          Height          =   255
  69.          Left            =   90
  70.          TabIndex        =   5
  71.          Top             =   120
  72.          Width           =   1275
  73.       End
  74.       Begin Threed.SSCommand cmdNP 
  75.          Height          =   300
  76.          Index           =   0
  77.          Left            =   6300
  78.          TabIndex        =   4
  79.          Top             =   90
  80.          Width           =   255
  81.          _Version        =   65536
  82.          _ExtentX        =   450
  83.          _ExtentY        =   529
  84.          _StockProps     =   78
  85.          Caption         =   "<"
  86.          BevelWidth      =   1
  87.          Font3D          =   3
  88.          RoundedCorners  =   0   'False
  89.          Outline         =   0   'False
  90.       End
  91.       Begin Threed.SSCommand cmdNP 
  92.          Height          =   300
  93.          Index           =   1
  94.          Left            =   7140
  95.          TabIndex        =   3
  96.          Top             =   90
  97.          Width           =   255
  98.          _Version        =   65536
  99.          _ExtentX        =   450
  100.          _ExtentY        =   529
  101.          _StockProps     =   78
  102.          Caption         =   ">"
  103.          BevelWidth      =   1
  104.          Font3D          =   3
  105.          RoundedCorners  =   0   'False
  106.          Outline         =   0   'False
  107.       End
  108.    End
  109. End
  110. Attribute VB_Name = "frmMediaID"
  111. Attribute VB_Creatable = False
  112. Attribute VB_Exposed = False
  113. Option Explicit
  114. Option Base 1
  115.  
  116. Private Const Iteration = 25
  117.  
  118. Dim IsLoaded         As Integer
  119.  
  120. Dim TimerStartOk     As Integer
  121. Dim TimerCloseOk     As Integer
  122.  
  123. Dim TimerHandle      As Integer
  124. Dim TimerValue       As Long
  125.  
  126. Private Sub cmdNP_Click(Index As Integer)
  127.  
  128.    Call sub_NextPrev(cmb_Function, Index)
  129.  
  130. End Sub
  131.  
  132.  
  133. Private Sub cmb_Function_Click()
  134.    
  135.    If (IsLoaded = False) Then Exit Sub
  136.    
  137.    Call cDisableFI(mdiT2W.Picture1)
  138.    
  139.    txt_Result = ""
  140.    
  141.    DoEvents
  142.    
  143.    Select Case cmb_Function.ListIndex
  144.       Case 0
  145.          Call TestMediaID
  146.       Case 1
  147.          Call TestVolume
  148.       Case 2
  149.          Call TestDOSMediaID
  150.    End Select
  151.    
  152.    DoEvents
  153.    Call cEnableFI(mdiT2W.Picture1)
  154.    
  155. End Sub
  156.  
  157.  
  158. Private Sub Form_Activate()
  159.  
  160.    mdiT2W.Label2.Caption = cInsertBlocks(mdiT2W.Label2.Tag, "" & Iteration)
  161.  
  162. End Sub
  163.  
  164. Private Sub Form_Load()
  165.  
  166.    IsLoaded = False
  167.    
  168.    Show
  169.  
  170.    Call sub_Load_Combo(cmb_Function, T2WDirInst + "_med-vol.t2w")
  171.    
  172.    IsLoaded = True
  173.    
  174. End Sub
  175.  
  176. Private Sub SSCommand1_Click()
  177.    
  178.    Call cmb_Function_Click
  179.    
  180. End Sub
  181.  
  182.  
  183.  
  184.  
  185.  
  186.  
  187.  
  188.  
  189. Private Sub TestMediaID()
  190.    
  191.    Dim intResult        As Integer
  192.    Dim strResult        As String
  193.    Dim strDisplay       As String
  194.    
  195.    Dim i                As Integer
  196.    
  197.    Dim MEDIAID          As tagMEDIAID
  198.   
  199.    strResult = ""
  200.    strDisplay = ""
  201.      
  202.    For i = 1 To 4
  203.       intResult = cGetMediaID(Chr$(64 + i), MEDIAID)
  204.       If (intResult = True) Then
  205.          strDisplay = strDisplay & "MEDIA ID found on drive '" & Chr$(64 + i) & "'" & vbCrLf & vbCrLf
  206.          strDisplay = strDisplay & "   VolumeName : '" & MEDIAID.VolumeName & "'" & vbCrLf
  207.          strDisplay = strDisplay & "   VolumeSerialNumber : '" & Hex$(MEDIAID.VolumeSerialNumber) & "'" & vbCrLf
  208.          strDisplay = strDisplay & "   SystemName : '" & MEDIAID.SystemName & "'" & vbCrLf
  209.          strDisplay = strDisplay & "   MaxNameLength : '" & MEDIAID.MaxNameLength & "'" & vbCrLf
  210.          strDisplay = strDisplay & "   FileSystemFlags : '" & MEDIAID.FileSystemFlags & "'" & vbCrLf & vbCrLf
  211.       Else
  212.          strDisplay = strDisplay & "MEDIA ID not found on drive '" & Chr$(64 + i) & "'" & vbCrLf & vbCrLf
  213.       End If
  214.    Next i
  215.  
  216.    txt_Result = strDisplay
  217.  
  218.    'time the function
  219.  
  220.    TimerHandle = cTimerOpen()
  221.    TimerStartOk = cTimerStart(TimerHandle)
  222.    
  223.    For i = 1 To Iteration
  224.       intResult = cGetMediaID("C", MEDIAID)
  225.    Next i
  226.    
  227.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  228.    
  229.    TimerCloseOk = cTimerClose(TimerHandle)
  230.  
  231. End Sub
  232.  
  233. Private Sub TestDOSMediaID()
  234.    
  235.    Dim intResult        As Integer
  236.    Dim strResult        As String
  237.    Dim strDisplay       As String
  238.    
  239.    Dim i                As Integer
  240.    
  241.    Dim DOSMEDIAID       As tagDOSMEDIAID
  242.   
  243.    strResult = ""
  244.    strDisplay = ""
  245.      
  246.    For i = 1 To 4
  247.       intResult = cDOSGetMediaID(Chr$(64 + i), DOSMEDIAID)
  248.       If (intResult = True) Then
  249.          strDisplay = strDisplay & "DOS MEDIA ID found on drive '" & Chr$(64 + i) & "'" & vbCrLf & vbCrLf
  250.          strDisplay = strDisplay & "   InfoLevel : '" & Hex$(cCVI(DOSMEDIAID.InfoLevel)) & "'" & vbCrLf
  251.          strDisplay = strDisplay & "   SerialNumber : '" & Hex$(cCVL(DOSMEDIAID.SerialNumber)) & "'" & vbCrLf
  252.          strDisplay = strDisplay & "   VolLabel : '" & cCompress(DOSMEDIAID.VolLabel) & "'" & vbCrLf
  253.          strDisplay = strDisplay & "   FileSysType : '" & cCompress(DOSMEDIAID.FileSysType) & "'" & vbCrLf & vbCrLf
  254.       Else
  255.          strDisplay = strDisplay & "DOS MEDIA ID not found on drive '" & Chr$(64 + i) & "'" & vbCrLf & vbCrLf
  256.       End If
  257.    Next i
  258.  
  259.    txt_Result = strDisplay
  260.  
  261.    'time the function
  262.  
  263.    TimerHandle = cTimerOpen()
  264.    TimerStartOk = cTimerStart(TimerHandle)
  265.    
  266.    For i = 1 To Iteration
  267.       intResult = cDOSGetMediaID("C", DOSMEDIAID)
  268.    Next i
  269.    
  270.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  271.    
  272.    TimerCloseOk = cTimerClose(TimerHandle)
  273.  
  274. End Sub
  275.  
  276. Private Sub TestVolume()
  277.    
  278.    Dim intResult        As Integer
  279.    Dim strResult        As String
  280.    Dim strDisplay       As String
  281.    
  282.    Dim i                As Integer
  283.   
  284.    strResult = ""
  285.    strDisplay = ""
  286.      
  287.    For i = 1 To 4
  288.       strDisplay = strDisplay & "Volume Label for '" & Chr$(64 + i) & "' is '" & cGetVolumeLabel(Chr$(64 + i)) & "'" & vbCrLf & vbCrLf
  289.    Next i
  290.  
  291.    txt_Result = strDisplay
  292.  
  293.    'time the function
  294.  
  295.    TimerHandle = cTimerOpen()
  296.    TimerStartOk = cTimerStart(TimerHandle)
  297.    
  298.    For i = 1 To Iteration
  299.       strResult = cGetVolumeLabel("C")
  300.    Next i
  301.    
  302.    mdiT2W.pnl_Timer = cTimerRead(TimerHandle)
  303.    
  304.    TimerCloseOk = cTimerClose(TimerHandle)
  305.  
  306. End Sub
  307.